package com.fin.zw.intelligentbot.entity;


import com.fin.zw.intelligentbot.enums.SourceType;
import lombok.Data;
import org.hibernate.annotations.Table;

import javax.persistence.*;
import java.util.Set;


@Entity
@Table(appliesTo = "category_label",comment = "客户分类标签")
@Data
public class CategoryLabel  extends BaseEntity {

    @Column(columnDefinition = "varchar(100) COMMENT '标签名称'")
    private String name;

    @Column(columnDefinition = "varchar(100) COMMENT '标签编码'")
    private String code;

    @Column(name="scene_type",columnDefinition = "varchar(100) COMMENT '场景类型'")
    private String sceneType;

    @ManyToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
    @JoinTable(name = "category_company", joinColumns = @JoinColumn(name = "category_id"), inverseJoinColumns = @JoinColumn(name = "company_id"))
    private Set<Company> companies;

    @Column(columnDefinition = "varchar(20) comment '来源方向(企业方还是超级管理)'")
    @Enumerated(EnumType.STRING)
    private SourceType source;

    @Column(columnDefinition = "varchar(64) COMMENT '创建者id'")
    private String createrId;

}
